<script setup lang="ts">
import Simplebar from 'simplebar-vue';
import 'simplebar-vue/dist/simplebar.min.css';

defineOptions({
  name: "w-scrollbar",
  inheritAttrs: false,
})

withDefaults(defineProps<{
  autoHide?: boolean;
}>(),{
  autoHide: false
})

</script>

<template>
  <Simplebar class="w-scrollbar" :auto-hide="autoHide" v-bind="$attrs"><slot></slot></Simplebar>
</template>

<style lang="scss" scoped>
.w-scrollbar{
  --scrollbar-color: #4497fa;
  :deep(.simplebar-scrollbar){
    &:before{
      background-color: var(--scrollbar-color);
    }
  }
}
</style>